package com.consumer.handsome.exception;

import lombok.Getter;
import lombok.Setter;

/**
 * 业务异常处理类
 *
 * @author Leng.c
 * @Date 2020-10-21 19:20
 */
@Setter
@Getter
public class BussinessException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    private String code;

    /**
     * 错误消息
     */
    private String msg;


    public BussinessException(CommonEnum commonEnum) {
        this.code = commonEnum.getResultCode();
        this.msg = commonEnum.getResultMsg();
    }

    public BussinessException(String msg) {
        this.msg = msg;
    }

    public BussinessException(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
